package com.sunny.fetch.pojo;

import javax.persistence.*;

@Table(name = "api_meta_param")
public class ApiMetaParam {
    @Id
    @Column(name = "param_id")
    private Long paramId;

    @Column(name = "api_id")
    private Long apiId;

    /**
     * 参数名称
     */
    @Column(name = "param_name")
    private String paramName;

    /**
     * 参数类型
     */
    @Column(name = "param_type")
    private String paramType;

    /**
     * 是否必选
     */
    private String required;

    /**
     * 描述
     */
    @Column(name = "param_desc")
    private String paramDesc;

    public ApiMetaParam(Long paramId, Long apiId, String paramName, String paramType, String required) {
        this.paramId = paramId;
        this.apiId = apiId;
        this.paramName = paramName;
        this.paramType = paramType;
        this.required = required;
    }

    public ApiMetaParam(Long paramId, Long apiId, String paramName, String paramType, String required, String paramDesc) {
        this.paramId = paramId;
        this.apiId = apiId;
        this.paramName = paramName;
        this.paramType = paramType;
        this.required = required;
        this.paramDesc = paramDesc;
    }

    public ApiMetaParam() {
        super();
    }

    /**
     * @return param_id
     */
    public Long getParamId() {
        return paramId;
    }

    /**
     * @param paramId
     */
    public void setParamId(Long paramId) {
        this.paramId = paramId;
    }

    /**
     * @return api_id
     */
    public Long getApiId() {
        return apiId;
    }

    /**
     * @param apiId
     */
    public void setApiId(Long apiId) {
        this.apiId = apiId;
    }

    /**
     * 获取参数名称
     *
     * @return param_name - 参数名称
     */
    public String getParamName() {
        return paramName;
    }

    /**
     * 设置参数名称
     *
     * @param paramName 参数名称
     */
    public void setParamName(String paramName) {
        this.paramName = paramName;
    }

    /**
     * 获取参数类型
     *
     * @return param_type - 参数类型
     */
    public String getParamType() {
        return paramType;
    }

    /**
     * 设置参数类型
     *
     * @param paramType 参数类型
     */
    public void setParamType(String paramType) {
        this.paramType = paramType;
    }

    /**
     * 获取是否必选
     *
     * @return required - 是否必选
     */
    public String getRequired() {
        return required;
    }

    /**
     * 设置是否必选
     *
     * @param required 是否必选
     */
    public void setRequired(String required) {
        this.required = required;
    }

    /**
     * 获取描述
     *
     * @return param_desc - 描述
     */
    public String getParamDesc() {
        return paramDesc;
    }

    /**
     * 设置描述
     *
     * @param paramDesc 描述
     */
    public void setParamDesc(String paramDesc) {
        this.paramDesc = paramDesc;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", paramId=").append(paramId);
        sb.append(", apiId=").append(apiId);
        sb.append(", paramName=").append(paramName);
        sb.append(", paramType=").append(paramType);
        sb.append(", required=").append(required);
        sb.append(", paramDesc=").append(paramDesc);
        sb.append("]");
        return sb.toString();
    }
}